<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f1(){
            var ul=document.querySelector("ul");//获取父元素的DOM对象
            var lis=document.getElementsByTagName("li");//获取li的集合

            //父元素的DOM对象.removeChild(子元素的DOM对象)
            ul.removeChild(lis[2]);

        }
        function f2(){
            var ul=document.querySelector("ul");//获取元素的DOM对象

            //元素的DOM对象.remove()
            //删除整个ul节点
            ul.remove();
        }
    </script>
</head>
<body>
    <input type="button" value="删除子元素" onclick="f1()" >
    <input type="button" value="删除子元素" onclick="f2()" >
    <ul>
        <li>li01</li>
        <li>li02</li>
        <li>li03</li>
        <li>li04</li>
        <li>li05</li>
    </ul>
</body>
</html>